﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace INF7GEN
{
    [Serializable()]
    public class ADVBookChoice : ISerializable
    {

        private string name = "";//internal name for choice
        private string text = "";//in game text for choice
        private String triggers = "";//what this choice points to in a triggers directive



        public ADVBookChoice()
        {

        }

        //--------------------------------------------------------------------
        //Serialization-------------------------------------------------------
        public ADVBookChoice(SerializationInfo info, StreamingContext ctxt)
        {
            this.name = (string)info.GetValue("CHOICEName", typeof(string));
            this.text = (string)info.GetValue("CHOICEText", typeof(string));
            this.triggers = (String)info.GetValue("CHOICETriggers", typeof(String));
        }

        public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
            info.AddValue("CHOICEName", this.name);
            info.AddValue("CHOICEText", this.text);
            info.AddValue("CHOICETriggers", this.triggers);
        }
        //-------------------------------------------------------------------



        public override string ToString()
        {
            string s = this.name;
            return "Choice: " + s;
        }

        /// <summary>
        /// The name of choice
        /// </summary>
        public string InternalName
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// The in game text of choice
        /// </summary>
        public string Text
        {
            get { return text; }
            set { text = value; }
        }

        /// <summary>
        /// The page internal-name triggered by this choice
        /// </summary>
        public String Triggers
        {
            get { return triggers; }
            set { triggers = value; }
        }



    }
}
